package com.shycloud.mido.task.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.shycloud.mido.common.core.util.R;
import com.shycloud.mido.task.api.entity.SmMemberTask;
import com.shycloud.mido.task.service.SmMemberTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * vip 任务模块 controller
 *
 * @author nianhua.jiang
 * @date 2020/8/27 11:21
 **/
@RestController
@AllArgsConstructor
@RequestMapping("/task")
public class VipTaskController {

	/** 任务模块 service */
	private SmMemberTaskService taskService;

	@GetMapping("/getTaskForVipPage")
	public R getTaskForVipPage(Integer orgId) {
		return new R(taskService.getTaskForVipPage(orgId));
	}

	@GetMapping("/checkTaskForPlayerPage")
	@ApiOperation(value = "播放器分享领取奖励查询")
	public R checkTaskForPlayerPage() {
		return new R(taskService.checkTaskForPlayerPage());
	}

	@GetMapping("getTaskByPageId")
	@ApiOperation("根据pageId获取活动信息")
	public List<SmMemberTask> getTaskByPageId(Integer pageId) {
		return taskService.list(new QueryWrapper<SmMemberTask>().eq("page_id", pageId));
	}

}
